<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <script src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>
    <script>
        $(function () {
            $('#btn').on('click',function(){
                $.ajax({
                    type:'get',
                    url:'${pageContext.request.contextPath}/ajax/test2',
                    dataType:'json',
                    success:function (res) {
                        // console.log(res)
                        if (res.status == 1){
                            console.log(res.data)
                        } 
                    }
                })
            })
        })
    </script>
</head>
<body>
    <button id="btn">发送Ajax请求</button>
</body>
</html>
